package oas.config;

import java.util.regex.Pattern;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.context.annotation.Import;
import org.springframework.core.type.filter.RegexPatternTypeFilter;

/**
 * 配置类，用于管理ContextLoadListener创建的上下文的bean
 *
 * @author liyue
 * @version v1.0.0
 */
@Configuration
@Import(DataConfig.class)
@ComponentScan(basePackages = {"oas"}, excludeFilters = { @Filter(type = FilterType.CUSTOM, value = RootConfig.WebPackage.class) })
public class RootConfig {

	/**
	 * 自定义扫描类，采用正则方式
	 *
	 */
	public static class WebPackage extends RegexPatternTypeFilter {

		public WebPackage() {
			super(Pattern.compile("oas\\.web"));
		}
	}
}